import request from '@/utils/request'

const sysCategoryApi = {

}

/**
 * 获取商品类别分页列表
 * @param data
 * @returns {AxiosPromise}
 */
sysCategoryApi.getPageList = data => {
  return request({
    url: '/sysCategory/plist/param',
    method: 'post',
    data
  })
}

/**
 * 商品类别详情
 * @param data
 * @returns {AxiosPromise}
 */
sysCategoryApi.detail = id => {
  return request({
    url: '/sysCategory/info/' + id,
    method: 'get'
  })
}

/**
 * 新增商品类别
 * @param data
 * @returns {AxiosPromise}
 */
sysCategoryApi.add = data => {
  return request({
    url: '/sysCategory/add',
    method: 'post',
    data
  })
}

/**
 * 修改商品类别用户
 * @param data
 * @returns {AxiosPromise}
 */
sysCategoryApi.update = data => {
  return request({
    url: '/sysCategory/update',
    method: 'post',
    data
  })
}

/**
 * 删除商品类别
 * @param data
 * @returns {AxiosPromise}
 */
sysCategoryApi.delete = id => {
  return request({
    url: '/sysCategory/delete/' + id,
    method: 'post'
  })
}

export default sysCategoryApi
